package net.uman.entity;

import java.io.Serializable;

public abstract class IdEntity implements Serializable,Id {
	private static final long serialVersionUID = 1L;
	protected Long id;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		
		if(getId() == null) return false;
		
		IdEntity entity = (IdEntity)obj;
		if (entity == null) {
			return false;
		}
		
		if(entity.getId() == null) return false;
		
		return getId().longValue()==entity.getId().longValue();
	}	
}
